package com.sdcs.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.sdcs.R;
import com.sdcs.model.Course;

public class CourseActivity extends Activity {
	private Course info ;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState); 
		setContentView(R.layout.info_info);
		
//获取上一个activity传过来的参数值
		info = (Course) getIntent().getSerializableExtra("food");

		TextView tv_name = (TextView) this.findViewById(R.id.name);
		tv_name.setText(info.getCourse_name()) ;
		 
		TextView biaoqian = (TextView) this.findViewById(R.id.biaoqian);
		biaoqian.setText(  " 描述: " + info.getCourse_description() ) ;

		TextView btn_discuss = (TextView) findViewById(R.id.btn_discuss) ;
		btn_discuss.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
		    	Intent intent = new Intent(CourseActivity.this , AnswerListActivity.class ) ;
				intent.putExtra("course_id", info.getCourse_id());
				startActivity( intent );
			}
		}) ; 
		
	}
	
	
}
